<?php require_once 'header.php';
require_once 'OwnerPage.php';
require_once 'backend/Item.php';
?>


	<div id = "pagecontent">
	<form method="post">
	  <fieldset>
	  <legend>Ingredients</legend>
	  <?php 
	 	$item = new Item();
	 	$result = $item->getAllIngredients();
	 	$item -> DisplayIngredients($result);
	  	if(isset($_POST['order']))
		{
			$temp = $_POST['order'];
			$item->Add100Quan($temp);
			?>
			<script language="JavaScript">window.location.href="Ingredients.php"</script>
			<?php
		}
	  ?>
	  
	  </fieldset>
	  </form>
	  <form action="Ingredients.php" method="post">
	  <fieldset>
	  <legend>New Ingredient</legend>
	  <?php 
	  	if(isset($_POST['Name']))
	  	{
	  		$name = ($_POST['Name']);
	  		$quantity = ($_POST['Quantity']);
	  		$price = ($_POST['Price']);
	  		$item->AddnewIngredient($name,$quantity,$price);
	  		?>
			<script language="JavaScript">window.location.href="Ingredients.php"</script>
			<?php
	  	}
	  ?>
	  <br><br>
		<div id = "Name">
			<font color = "red" size = "3">Name : <p/></font>
			<input  name="Name" type="text">
			<p/>
		</div>
		
		<div id = "Quantity">
			<font color = "red" size = "3">Quantity : <p/></font>
			<input  name="Quantity" type="text">
	        
		</div>
		
		<div id = "Price">
			<font color = "red" size = "3">Price : <p/></font>
			<input  name="Price" type="text" >
		</div>
		
		<p><input type="submit" value="Add Ingredient" />
		<input type='reset' value='Clear'/>
		</p>
	  </fieldset>
	  </form>
	</div>
	
<?php require_once 'footer.php';?>